Preferences

You can use the Preferences command to customize much of TextWrangler's behavior. You can decide which windows are open when you launch TextWrangler, set the default options for windows, set the default options for searches, and so on. This chapter describes TextWrangler's extensive preference options.

The Preferences Command

The Preferences window provides control over many aspects of TextWrangler's behavior. You can decide which windows should open when you launch TextWrangler, set the default display options for windows, set default options for editing behavior and searches, and so on.

TextWrangler 2 employs standard OS services to store its preference settings, bringing improved durability and performance. TextWrangler's use of these services also makes it possible for you to modify preference settings directly using appropriate "defaults write" commands (see Optional settings via `defaults write'). However, the Preferences window remains the standard interface for making and changing preference settings.

IMPORTANT

You should not arbitrarily remove your TextWrangler preferences file, as doing so will require you to re-select any customized preference options you may have chosen.

Note

If you chose to modify your preferences by means of "defaults write" commands other than those documented here, without explicit advice from Bare Bones Software technical support, you take responsibility for any adverse effects.

To open the Preferences window, choose the Preferences command from the TextWrangler menu.

The small text area at the top left of the Preferences window gives you a brief description of the contents of the currently displayed preference panel.

The list along the left side of the window lets you select the preference panel to use.

TextWrangler's Preferences window is non-modal: you can leave it open and change preference settings while you work, or close it at any time by clicking its close button or by choosing Close Window from the File menu.

Any changes you make to preference settings will be stored immediately, though not every setting will take effect immediately. Some options are only checked or applied at application launch, as mentioned in their descriptions.

The following sections describe each of the preference panels in detail.

Application Preferences

The Application preferences control which application and system services TextWrangler uses, when open files are verified, and various other global settings.

Optional Mac OS Services

QuickTime? Translation

If you mark this checkbox and have a recent version of QuickTime installed, TextWrangler will ask QuickTime if it recognizes any files that TextWrangler does not. If QuickTime recognizes the file as one it can display, TextWrangler will open it for viewing; otherwise, the file will be opened as "raw" text. This option is on by default.

Don't Translate PDFs

If the supplemental option Don't Translate PDFs is checked, TextWrangler will not attempt to apply QuickTime translation to PDF files. This option is on by default.

QuickTime? Playback

This checkbox controls whether TextWrangler opens QuickTime movies for playback in a movie window or just opens them as text data in an editing window. The default is to recognize QuickTime movies and display them with a player. Changes to this preference take effect immediately.

Optional Application Services

BBEdit Plug-ins

When this option is selected, TextWrangler makes the Tools menu available in the menu bar so that you can use plug-ins (code modules that add functionality to TextWrangler). Third-party plug-ins are kept in TextWrangler's application support folders. See Chapter 2 to learn more about the organization of TextWrangler's application folders, or Chapter 13 for information about plug-ins.

Script Menu

This option controls whether TextWrangler will display the Script menu in its menu bar. If you prefer to always use the global Script menu, turn this option off. TextWrangler's built-in Script menu does, however, offer a number of advantages over the system-wide Script menu, not the least of which is that it runs scripts in the application's context. Changes to this option will take effect the next time you launch TextWrangler.

Text Factories Menu

This option controls whether TextWrangler will display the Text Factories menu in its menu bar. Changes to this option will take effect the next time you launch TextWrangler.

Always Show Full Paths in "Open Recent" Menu

Mark this checkbox to always show the complete pathname of recently opened files, rather than just their names, in TextWrangler's Open Recent submenu. If a recent file is missing, only its name will appear, regardless of this setting. Also, if two or more files have identical filenames, their complete pathnames will always be shown to prevent ambiguity, regardless of this setting.

Allow Menu Key Equivalents to Autorepeat

Mark this checkbox to enable autorepeat when typing key equivalents. This option is off by default. (According to the Macintosh Human Interface Guidelines, menu commands should not autorepeat. If you chose to enable this option, you do so forewarned.)

When Dragging, Show

These radio buttons control the way selected text is displayed while tracking mouse movements during a drag-and-drop operation: choose Outline Only to have the selection displayed as an outline, or Translucent Image to have the selection displayed as visible, translucent text.

List Display Font

This option controls the font and size used to display text in browser list panes, including disk browser, search results browsers, etc. To change this option, click Set to bring up the standard Font panel, and choose the desired font and size. The default setting is 11 point Lucida Grande.

Verify Open Files After

If you frequently make changes to files with another program while they are open in TextWrangler, or you often edit shared files that might be changed by someone else, you may want to mark one or more of these checkboxes. If the option for Activating TextWrangler is checked, for instance, TextWrangler will check the modification date of each open document every time you switch to TextWrangler, alerting you if any changes have been made to the file while TextWrangler was not the frontmost application. Similar functions are available to perform this check after running an AppleScript, a TextWrangler plug-in, or a Unix script, or activating a text window.

The effects of the Revert command (from the File menu), and of a file Reload (which occurs when a document is reloaded by a verify action) are now both undoable.

Remember the N most recently used items

This text field lets you choose how many files appear on the Open Recent sub-menu of the File menu, and how many folders appear on the folder search pop-up menu in the Find Differences folder lists.

Browser Display Preferences

The Browser Display preferences control the initial appearance of TextWrangler's built-in browsers for search results, compile errors, disk contents, and so forth.

Results Lists

For search results browsers, you can have TextWrangler display either a hierarchical listing (where all the matches associated with a particular file are grouped under that file, using disclosure triangles similar to those in the Finder's list views to reveal or hide the match list) or a flat listing showing each individual match encountered on a separate line. In the former case, you can also tell TextWrangler to expand all the file nodes initially, by checking Expand Listing. This preference also governs the default display of hierarchical or flat error listings in error browsers.

Disk Browsers

When the Show File Icons option is active, disk browser windows will display small icons for every item (files, folders, and disk volumes) in the file list. When this option is off, disk browsers will list only the names of files and folders.

Contextual Menu Preferences

The Contextual Menu preferences control which commands TextWrangler will present on its contextual menu. You can show or remove commands in any category by enabling or disabling the appropriate option.

Differences Preferences

The Differences preferences control the way the Find Differences command places its windows.

Arrange Windows on

The Arrange Windows radio buttons let you choose which screen TextWrangler uses to display Differences windows. You can choose the main screen, the largest screen, or the smallest screen.

When you mark the Use Two Screens checkbox, TextWrangler displays the Differences window on the second screen. This option gives you the largest view of the items you are comparing.

Keep Windows Arranged provides control over whether TextWrangler rearranges the windows being compared when you click a difference item.

Differences Window Placement

The Beneath/Above Compared Files radio buttons let you choose whether the differences window should be placed below or above the windows of the documents you are comparing.

Arrange Windows

You can specify whether differences windows are arranged left to right or top to bottom using the Arrange Windows radio buttons.

Multi-File Differences

When comparing multiple files, the Show File Icons checkbox determines whether the files' Finder icons are shown in the Differences window.

Options

The Keep Windows Arranged option controls whether TextWrangler should attempt to automatically resize and reposition windows during a Find Differences operation.

Documents Preferences

The Documents preferences control how TextWrangler handles opening text documents and creating text windows.

New & Opened Documents

You can specify whether newly created or opened documents always should be opened into the frontmost text window, or whether each document should be opened into its own text window.

Documents Opened from Other Applications

You can specify whether documents opened from other applications should be opened into the frontmost text window, or whether each document should be opened into its own text window.

Examples of opening documents from another application include using the "Edit in TextWrangler" command from an FTP client such as Interarchy, and double-clicking files in the Finder.

Open the Documents Drawer

You can specify when a new text window will display the Documents Drawer: always, only if the window contains two or more documents, or never.

Open the Documents Drawer on the

You can specify whether the Documents Drawer should be displayed on the left-hand or right-hand side of text windows by default.

Warn Before Closing a Window Containing Multiple Documents

Choose this option to have TextWrangler warn you when you attempt to close a window with more than one document in it. This warning will not occur if:

Allow Documents Drawer to Acquire Keyboard Focus

Choose this option to prevent the Documents Drawer from also gaining keyboard focus when you click in it. When this option is on, you will not be able to use typeahead or the arrow keys to move among open documents in the drawer.

Editing: General Preferences

The Editing: General preferences control the behavior of various general editing behaviors.

Allow Single-Click Line Selection

If the checkbox is turned on, clicking in the left margin of an editing window selects an entire line. (If you have line numbers displayed, via the Show Line Numbers option in the Text Status Display preference panel, you can click in the line number as well.) The pointer changes to a right arrow when it is in the left margin. Click and drag to select multiple lines. Double-click to select an entire paragraph; double-click and drag to select a range of paragraphs.

If this option is off, clicking in the left margin moves the insertion point to the beginning of the clicked line.

Double-Click to Balance

When this preference is turned on, you can double-click any opening or closing parenthesis, brace, or bracket-- ( ) { } [ ] --to select the entire range of text enclosed by a balanced pair.

Confirm Non-Undoable Editing Actions

To have TextWrangler stop warning you when you are about to perform an action that cannot be undone, turn this checkbox off.

Use "Hard" Line Numbering in Soft-Wrapped Views

If this switch is turned on, the line number bar, cursor position display, and Go To Line commands in editing views will use line numbers that correspond to "hard" carriage returns in the document, rather than to soft-wrapped line breaks.

Extra Space in Text Views

To have TextWrangler leave extra empty space when you scroll to the end of a text view, choose Half Window or Full Window here.

Turn Off Text Smoothing

This option allows you to choose the font sizes for both fixed width and proportional fonts at and below which TextWrangler will not employ text smoothing.

Editing: Keyboard Preferences

The Editing: Keyboard preferences control TextWrangler's response to the use of various special keys.

Enable Shift-Delete for Forward Delete

When this option is selected, holding down the Shift key with the Delete key makes the Delete key work the same way as the Forward Delete key on extended keyboards. This feature is particularly useful on PowerBooks.

Use Numeric Keypad for Cursor Movement

To use the numeric keypad to move the insertion point, select this option.

start of line

7

up

8

scroll up

9

left

4

show selection

5

right

6

end of line

1

down

2

scroll down

3

You can use the Shift key with the keys on the numeric keypad to extend a selection. You can use the Command and Option keys with the 2, 4, 6, and 8 keys as you would the arrow keys.

To toggle the behavior of the keypad between moving the cursor and entering numbers, hold down the Option key and press the Clear key in the upper-left corner of the keypad. (This key is also labeled Num Lock on some keyboards.)

When Auto-Indenting

This option controls whether TextWrangler should remove any existing leading whitespace from lines which it applies auto-indentation to.

"Home" and "End" Keys

Choose "Scroll to Beginning and End of Document" to have the Home and End keys perform these respective actions. This is the default setting, which reflects the standard key motion behavior in Macintosh applications.

Choose "Move Cursor to Beginning and End of Current Line" to have the Home and End keys perform these respective actions instead. This option may be useful for those accustomed to Windows editing key behavior.

Exchange Command and Option Key Behavior

These two checkboxes let you swap the meaning of the Option and Command keys when used with cursor navigation keys to move through a window's contents. You can set this separately for horizontal and vertical cursor movement. For details on using cursor navigation keys, see Chapter 4 and Appendix B.

Use Emacs Key Bindings

If turned on, this option allows you to use the basic Emacs navigation keystrokes to move around in editing views. It is not a full Emacs emulation mode; rather, it is more of a comfort blanket for individuals with Emacs key bindings hard-wired into their muscle memory. See Appendix B, "Editing Shortcuts," for a list of the Emacs commands TextWrangler supports.

If you turn on the Display Status Window option, a small palette will appear when you type an Emacs shortcut, indicating which command you have applied.

Option-¥ on Japanese Keyboards

This option controls whether typing Option-yen on a Japanese keyboard generates a yen symbol " ¥ " or a backslash "\".

Editor Defaults Preferences

The Editor Defaults preferences control the behavior of newly created document windows and documents without saved state information. Many of the preferences in this panel are the same as those in the Text Options dialog and in the Text Options pop-up menu in the status bar. The difference is that the text options control the behavior of the active window, while the Editor Defaults preferences control the behavior of new windows.

Auto-Indent

When this option is selected, pressing the Return key in new windows automatically inserts spaces or tabs to indent the new line to the same level as the previous line.

Tip

To temporarily invert the sense of the Auto Indent option while typing, hold down the Option key as you press the Return key.

Balance While Typing

When this option is selected, TextWrangler flashes the matching open parenthesis, brace, bracket, or curly quote when you type a closing one. This option is useful when you are editing source files, to ensure that all delimiters are balanced.

Smart Quotes

When this option is on, TextWrangler automatically substitutes curly (or typographer's) quotes (" " ` ') for straight quotes (" ').

Tip

To type a straight quote when this option is selected (or to type a curly quote when the option is deselected), hold down the Control key as you type a single or double quote.

Note

You should avoid using Smart Quotes when creating or editing HTML documents and email message content.

Auto-Expand Tabs

When this option is selected, TextWrangler inserts an appropriate number of spaces instead of a tab character every time you press the Tab key.

Show Invisibles

This option shows or hides non-printing characters in the window. Select this option when you want to see line breaks, tabs, and gremlins (invisible characters). TextWrangler uses these symbols to represent non-printing characters:

Symbol

Meaning

Δ

tab

space

·

non-breaking space

¬

line break

page break

¿

other non-printing characters

Show Spaces

If this setting is selected (and Show Invisibles is active), TextWrangler will display placeholder characters for spaces. Deselect this option to suppress the display of spaces, which will reduce clutter when you are displaying invisible characters.

Note

Non-breaking spaces (typed by pressing Option-space) will not be displayed with a placeholder.

Syntax Coloring

When this option is selected and the editing window contains a document in one of the languages that TextWrangler knows how to parse, TextWrangler displays keywords and other language elements in color.

The languages that TextWrangler knows about are those listed in the Languages panel of the Preferences window. Remember that the document must be saved to a file and that the file must end with a suffix (extension) that maps to a language that TextWrangler can parse.

You can select the colors that TextWrangler uses for syntax coloring in the Text Colors panel of the Preferences window.

Soft Wrap Text

When this option is selected, TextWrangler soft-wraps the text in the file to the right margin that you choose: the Page Guide, the window width, or a specific number of characters, as selected by the options below the checkbox.

Default Font

This option controls the standard font and font size, and the number of spaces per tab, which TextWrangler uses to display the contents of text windows. To change this option, click Set to bring up the standard Font panel, and choose the desired font and size, or tab width. The default setting is 9 point Monaco, with 4 spaces per tab.

File Search Preferences

The File Search preferences control the way TextWrangler searches for files when you use the Open File by Name or Open Selection command from the File menu.

Find All Matching Files

When this option is selected, TextWrangler looks for all the files that match the entered or selected text. Otherwise TextWrangler stops looking as soon as it finds the first file that matches the selected name.

Skip (...) Folders

When this option is selected, TextWrangler does not search folders whose names are enclosed in parentheses.

Search Folders

The Search Folders box displays a list of folders which TextWrangler will search in response to an Open File by Name or Open Selection command, or a Control-Tab to locate the corresponding source or header file. The contents of each listed folder will be searched recursively, i.e. the contents of any subfolders will also be searched.

To add folders to the list, do any of the following:

  • Click the Choose button and select the folder from the directory selection dialog.
  • Drag the icon of the folder to the path box.

To change the target folder for an existing entry, select it from the list, click "Change", and choose a new folder using the directory selection dialog.

To remove folders from the list, select them, and click "Remove".

Unix Search Paths

The Unix Search Paths box displays a list of folders which TextWrangler will search in response to an Open File by Name or Open Selection command, or a Control-Tab to locate the corresponding source or header file. The contents of each listed folder will only be searched directly, i.e. without recursion.

Unix search paths are designed to make it easier to work with Unix source code, which uses include statements of the form

#include <xxx/yyy.h>

As a more concrete example: the canonical Unix include directory is "/usr/include". It contains its own subdirectories, but since Unix command line compilers do not usually do recursive searches, you need to qualify the include file's name if you want to include a file out of one of the subdirectories:

#include <sys/ioctl.h>

With the Unix Search Paths settings, you can add "/usr/include" to the list (actually, this is one of the factory defaults). When you select "sys/ioctl.h" and choose Open Selection, BBEdit attempts to construct a file path using each of the directories shown in the Unix Search Paths list. If one resolves to a file, BBEdit will open the resulting file. Thus, the partially qualified selection "sys/ioctl.h" resolves to

/usr/include/sys/ioctl.h

and the file opens.

FTP Settings Preferences

The FTP Settings preferences let you change the default settings of some options in the Open from FTP/SFTP Server and Save to FTP Server dialogs.

Remember Bookmark Passwords

Mark this checkbox to have TextWrangler store the passwords for FTP sites.

Store Passwords in Keychain

This checkbox determines whether TextWrangler stores saved FTP passwords in the system Keychain or whether they are stored in plain text in the bookmarks file.

Warning

TextWrangler is not a security program. If you choose not to use the Keychain, your stored FTP server passwords can be easily obtained by anyone with access to your computer. As an alternative, we suggest you consider using a secure bookmark storage application such as Web Confidential <http://www.web-confidential.com/>.

Include Passwords in Proxy URL Drags

Dragging the window proxy icon from an editing window corresponding to a file opened from an FTP server will drag that file's URL, rather than a representation of the local temporary file. To control whether the dragged URL includes the FTP account password, set the Include Passwords in Proxy URL Drags checkbox. This setting is turned off by default so that you do not accidentally create clippings containing passwords, as this may be a security risk.

List FTP Files on the "Open Recent" Menu

Mark this checkbox to show files opened from FTP sites on the Open Recent submenu of the File menu. (If this box is not checked, the Open Recent submenu lists only local files.)

Passive FTP

Mark this checkbox to make passive FTP mode (where the server determines the port number for the FTP connection) the default. Use Passive FTP whenever possible.

Show Document Icons

Mark this checkbox to display icons for the files in the Open from FTP/SFTP Server and Save to FTP Server dialogs. Since FTP servers do not provide Macintosh type and creator information, TextWrangler determines the displayed icon based on the file's name suffix (.html, .sit, and so on).

Note

Mac OS X does not currently provide any direct interface for configuring these suffix-to-type mappings. However, you can use Internet Explorer's File Helper preferences, or a third-party System Preferences pane such as RCDefaultApp for this purpose.

Show Files Starting with "."

The Unix convention for creating invisible or hidden files is to begin their names with a period. Often, configuration files and scripts (such as .newsrc or .login) begin with periods so that they do not clutter most directory listings. This setting is off by default, so that you will not see such files in FTP listings. To display them, mark this checkbox.

FTP Bookmarks

This list displays the bookmarks you have defined for FTP servers you use frequently with TextWrangler. Click Add to create a new bookmark, click Change to edit the selected bookmark, or Remove to delete it.

When adding or editing a bookmark, set the SFTP option in the Edit Bookmark dialog to have TextWrangler connect to this server via SFTP; if the option is unchecked, TextWrangler will use FTP instead.

Note

If you have the Preferences window open, you will not be able to add bookmarks in the Open From/Save To FTP Server dialogs. To work around this, close the Preferences window before using the FTP dialogs to add new bookmarks.

Function Popup Preferences

The Function Popup preferences control how the Function pop-up menu (left) in the status bar behaves.

Show Includes

When this option is selected, the Function pop-up menu includes the files named in #include directives.

Sort Items by Name

When this option is selected, the items in the Function pop-up menu are sorted by name. Otherwise, items in the pop-up menu appear in the same order as they appear in the file.

Show Function Prototypes

When this option is selected, the Function pop-up menu includes the names of function prototypes as well as the function definitions. Otherwise, the pop-up menu does not include entries for function prototypes.

Languages Preferences

The Languages preferences allow you to configure how TextWrangler maps file names to language types (e.g. ".html" to HTML), and to configure certain parameters for each supported language.

Installed Languages

The list of installed languages includes both languages intrinsically supported by TextWrangler, and those provided via additional language modules.

Choose a language and click "Make Default" to use that language as the default when creating new text documents, and when opening text documents for which the language cannot otherwise be guessed (by mapping the file's suffix or examining its content). The default setting is "(none)".

To configure the comment-start and comment-end strings used by the Un/Comment command on the Text menu for a particular language, choose it from the list, click "Options", and edit its comment strings as desired.

Suffix Mappings

By default, TextWrangler offers a set of file suffix-to-language mappings which covers the common usages for each supported language.

To add a new suffix mapping:

Click Add.

The Add Suffix dialog appears.

  1. Enter the suffix, choose the associated language from the pop-up menu, and click a radio button to tell BBEdit whether this type of file is a source file, an include file, or neither.
  2. Click Add to save the new mapping.
Note

You can use wildcards in the suffix to indicate single characters (?), any number of characters (*), or a single digit (#). For example, "page.#html" could map to a different language from ".html".

To change an existing suffix mapping:

Select an item from the list.
  1. Click Change.

The Change Suffix dialog appears.

  1. Fill in the Change Suffix dialog with the appropriate suffix, choose a language from the pop-up menu, and select a radio button to indicate whether this type of file is a source file, an include file, or neither.

To delete a suffix mapping:

Select an item from the list.
  1. Click Remove.

To reset all suffix mappings to default settings:

Click Reset All.

Software Update Preferences

The Software Update preferences control the integrated version-checking capability built into TextWrangler.

The Check Automatically checkbox controls whether TextWrangler automatically looks to see if there is a new version available from Bare Bones Software. Regardless of the setting of the checkbox, you can always check manually by clicking the Check Now button.

The version checking mechanism used by TextWrangler protects your privacy. It works by requesting information about the currently available version from Bare Bones Software's web server. The server will log the date, time and originating address of the request, and which versions of the OS and TextWrangler you are using. This information is used to guide the future development of TextWrangler; it is not personalized and will not be disclosed.

Spelling Preferences

The Spelling preferences control whether TextWrangler uses the Mac OS X system spelling checker, or an external spelling checker.

Built-In

This option specifies that TextWrangler should use the Mac OS X system spelling checker when you choose the Check Spelling command from the Text menu.

Word Services

When this option is selected, TextWrangler uses an external spelling checker when you choose the Check Spelling command from the Text menu. The external spelling checker must support Apple's Word Services Suite.

To set the external spelling checker, click the Set button and select the application's icon. You can also drag the spelling checker icon to the path box to the left of the Set button.

Startup Preferences

The Startup preferences control what TextWrangler does when you launch it, or when you click on TextWrangler's Dock icon or double-click its icon in the Finder and there are no open windows (even if the application is already running).

Do Nothing

This option specifies that TextWrangler should not open any windows or perform any other actions.

New Text Document

This option specifies that TextWrangler should open a new, empty text editing window.

New Disk Browser

This option specifies that TextWrangler should open a disk browser starting at the desktop.

New FTP Browser

This option specifies that TextWrangler should open an FTP browser.

Open

This option specifies that TextWrangler should bring up the standard Open dialog, allowing you to select and open a file.

Open from FTP/SFTP Server

This option specifies that TextWrangler should bring up the Open from FTP/SFTP Server dialog, allowing you to connect to an FTP server and open a file.

You can hold down the following modifiers during launch to override these actions.

Modifier(s)

Function

Option

Suppress startup items only

Shift

Disable all plug-ins, tools, external services, and startup items

Text Colors Preferences

The Text Colors preferences let you select the colors that TextWrangler uses when the syntax coloring option is on. You can also select a custom window background color and text color, as well as custom highlight colors, which will apply to all text windows, although we feel compelled to point out that there are good reasons why the default Macintosh text color scheme is what it is.

Guide Contrast

You can use this sliding control to adjust the contrast level of the page guide display region. (See "Show Page Guide".)

Activating Syntax Coloring

You can turn on syntax coloring globally by setting the Syntax Coloring option in the Editor Defaults preference panel. You can choose the colors which TextWrangler uses for various content elements, such as keywords, string constants, etc., in the Text Colors preference panel.

Note

For HTML content, you can turn on the Color Attributes Separately option to have TextWrangler use different colors for HTML attribute names, attribute values, and processing instructions, in addition to anchor, image, and other tags. If this option is turned off, TextWrangler will color HTML attributes identically to their corresponding tags.

How to Change Colors

The color bars show the colors that TextWrangler uses to display different interface and language elements. To change colors, click the color box. TextWrangler will open the system Color Picker dialog box that you can use to select a new color. To restore all the colors to their default settings, click the Reset to Factory Colors button.

Highlight Insertion Point

When this option is turned on, TextWrangler will highlight the line currently containing the insertion point using the indicated color. (The highlighting will be temporarily dismissed whenever a text selection is made.)

Text Encodings Preferences

When opening documents, TextWrangler can automatically recognize and appropriately handle files that use character set encodings other than Mac Roman, including multi-byte character sets.

The Text Encodings preferences panel presents an alphabetical list of every character set encoding available in Mac OS X, and allows you to choose which of these items should appear in the pop-up menus that list encodings. These pop-up menus are:

To include an encoding in those menus, select it and click Enable. To remove an encoding from those menus, select it and click Disable. To add all the encodings or remove all the encodings from the menus, use the Enable All and Disable All buttons. To restore the contents of those menus to the factory defaults, use the Restore Defaults button.

All the Unicode encodings are permanently enabled and cannot be turned off.

Tip

To keep the length of the encoding menus manageable, you should add only those encodings which you use frequently.)

Text Files: Opening Preferences

The Text Files: Opening preferences control TextWrangler's behavior when it opens files.

Translate Line Breaks

When this option is selected, TextWrangler translates DOS or Unix line breaks when opening a file. Otherwise TextWrangler leaves the original line breaks untranslated.

If a File's Type Is Unknown

These settings tell TextWrangler how to deal with files whose type and creator codes are not set. Usually, such files are created by Unix programs, but they may also be downloaded from remote servers. You can choose:

Note

Mac OS X includes a default set of mappings, but provides no direct interface for configuring them. However, you can use Internet Explorer's File Helper preferences, or a third-party System Preferences pane such as RCDefaultApp, for this purpose.

You should select whichever setting makes the most sense for the sorts of files you work with. For example, if you often download or work with files which lack filename extensions, but you know that they always contain text, you can select "Assume It's Text".

Link File's Encoding to HTML/XHTML Character Set

When this option is selected, TextWrangler will use the character set specified in the appropriate HTML meta tag or XML declaration to determine a file's encoding when opening the file. Also, when this option is on, changing an HTML or XML document's character set with the Character Set markup command will adjust the file's encoding to match (as indicated on the Encoding submenu of the File Options popup in the status bar), and changing the file's encoding will adjust the character set declaration (if one exists). This option is on by default.

When this option is off, then TextWrangler does not attempt to use the character set specified in the HTML meta tag or XML declaration, but will follow the usual procedure for determining the file's character set. (See "Choosing the Encoding for a Document" in Chapter 3 of the user manual.) The only reason you might want to turn this option off is if you routinely put characters into your document that cannot be represented in the declared character set, e.g. if you will be post-processing the file by some other means which modifies these characters.

If the File's Encoding Can't Be Guessed, use

This menu determines which character set encoding to use when TextWrangler cannot determine the proper encoding by examining the file. This setting also establishes the default setting of the "Read As:" pop-up menu in the Open dialog.

Warn of Malformed UTF-8 Files

When this option is selected, TextWrangler warns you if you open a UTF-8 file that contains an invalid UTF-8 character sequence.

Honor Saved State

When this option is selected, TextWrangler honors state information that may be stored in a file. The following suboptions let you fine-tune which state information TextWrangler honors.

Window Position

When this option is selected, TextWrangler restores the window of the document to the same position as when the file was closed. Otherwise TextWrangler opens the window in its default position.

Font Settings

When this option is selected, TextWrangler restores the font information stored with a document. Otherwise it uses the default font settings.

Selection Range

When this option is selected, TextWrangler restores the insertion point or selection range to the same position as when the file was closed. Otherwise the insertion point is at the beginning of the file.

Emacs Local Variables

Emacs (the popular Unix text editor) supports a convention in which you can define Emacs-specific settings in a block of text near the end of the file, or in the first line of the file. TextWrangler now recognizes the Emacs variable block, and can optionally read and set certain variables.

If this option is selected, TextWrangler will use the "coding" variable, whose value is the Internet text encoding name in which the file is written, e.g. "iso-8859-1" or "utf-8" to interpret the file's contents when opening it.

Scrollbar Position

When this option is selected, TextWrangler restores the scroll bar position to the same position as when the file was closed. Otherwise TextWrangler opens the file with the top of the file showing.

Option Settings

When selected, TextWrangler reads document-specific options, such as soft wrap, show invisibles, and line numbering, from the saved state information.

Text Files: Saving Preferences

The Text Files: Saving preferences control TextWrangler's behavior when it saves files, including file backup settings.

Force New Line at End

When this option is selected, TextWrangler will always add a line break at the end of the file if it does not already end with one.

Default Line Breaks

These options let you choose what kinds of line breaks TextWrangler writes when you save the file. You can choose:

  • Macintosh line breaks (ASCII 13) if you are using the file only on a Macintosh.
  • Unix line breaks (ASCII 10) if the file resides on a Unix file server or if you are sending it to someone who uses Unix.
  • DOS line breaks (ASCII 13/10) if the file resides on a DOS file server or if you are sending it to someone who uses a DOS system

Additionally, if the Use Unicode Line Breaks option is selected, TextWrangler will use Unicode line breaks by default for newly created (or converted) Unicode documents, instead of the chosen platform-specific line breaks.

Default Text Encoding

This menu determines which character set encoding TextWrangler will save a document with, if the document does not contain an encoding specification.

Make Backups Before Saving

Select this checkbox to tell TextWrangler to make automatic backup copies of every file as you save it. This preference setting establishes the defaults for newly created documents, and for documents in which there are no saved backup settings.

If you prefer that TextWrangler create backup files in the same folders that your documents are already saved in, choose the option for Use Document's Folder. This is the default setting. If you prefer to save backups in a different folder, choose the Use Folder setting instead. You can click the Choose button to select the desired backup folder using a dialog, or just drag the folder to the box.

Even if you do not set TextWrangler to perform general backups here, you can still set backup options for individual files by using the Backup Options command in the File menu.

Save Document State

Select this option to have TextWrangler store document state information. A document's state information includes various display properties, such as window position, font settings, etc. This information is now stored centrally by TextWrangler; it is no longer a property of a document's file. You can control how TextWrangler makes use of state information via the Honor Saved State options in the Text Files: Opening preferences panel.

Emacs Local Variables

Emacs (the popular Unix text editor) supports a convention in which you can define Emacs-specific settings in a block of text near the end of the file, or in the first line of the file. TextWrangler now recognizes the Emacs variable block, and can optionally read and set certain variables.

If this option is selected, TextWrangler will change the value of the "coding" variable in the variable block to be the Internet text encoding name which corresponds to the document's encoding (and will write out a variable block if necessary).

Text Printing Preferences

The Text Printing preferences control how TextWrangler prints your documents.

Default Font

To set the default printing font, click the Default Font button. TextWrangler opens the Font panel, in which you can specify the font and font size, and the width of tab stops. The current printing font settings appear in the display box to the right of the button.

Use Document's Font

When this option is selected, TextWrangler uses the document's font and tab settings when printing.

Frame Printing Area

When this option is selected, TextWrangler draws a box along the edges of the printed text.

Print Page Headers

When this option is selected, TextWrangler prints the page number, the name of the file, the time and date printed in a header at the top of each page.

Print Full Pathname

When this option is selected, TextWrangler prints the full pathname of the file being printed in the header.

Print Line Numbers

When this option is selected, TextWrangler prints line numbers along the left edge of the paper.

1-Inch Gutter

When this option is selected, TextWrangler leaves a one-inch margin along the left edge of the paper. Use this option if you usually put your pages in three-ring binders.

Print Color Syntax

If this checkbox is marked, TextWrangler prints colorized text in color. You should generally use this option only on color printers, as colorized text may come out in difficult-to-read dithered shades of gray on black-and-white printers.

Time Stamp

The Time Stamp options let you choose whether the date that appears in the header is the date that the file was last modified or the date that the file was printed.

Print Rubber Stamp

The Print Rubber Stamp option allows you to specify a text string which will print on your documents in enlarged, low density (grey) form using the selected font.

Text Search Preferences

The Text Search preferences let you set default options to use with the Find command.

Report Single-File "Replace All" Results

When this option is selected, TextWrangler displays a dialog telling you how many replacements it made when you perform a Replace All operation on a single file.

Remember Find Dialog's "Start At Top" Setting

Mark this checkbox to have TextWrangler remember the state of the Start At Top checkbox in the Find & Replace dialog from one invocation to the next.

Color Grep Patterns in Find Dialog

When this preference is turned on, and Use Grep is turned on in the Find & Replace dialog, TextWrangler will apply syntax coloring to grep search and replace patterns.

Grep Patterns

This list displays all the grep patterns (regular expressions) you have defined for use in the Find & Replace dialog's Patterns pop-up menu. Click Add to add a new one, click Change to edit the selected pattern, or click Remove to delete the selected pattern.

Note

If you have the Preferences window open, you will not be able to add grep patterns from the Find & Replace dialog. To work around this, close the Preferences window before using the Find & Replace dialog to add new grep patterns.

Text Status Display Preferences

The Text Status Display preferences let you choose which icons and pop-up menus appear in the status bar of TextWrangler text windows.

All Windows:

The following options determine which controls and navigation items TextWrangler should display by default in text windows and text panes.

Show Status Bar

Enable this option to have TextWrangler display the status bar by default. (You can always show it or hide it independently for each window.)

Show Navigation Bar

Enable this option to have TextWrangler display the multiple-document navigation bar by default. (You can always show it or hide it independently for each window.)

Show Cursor Position

This option adds a panel at the bottom-left corner of the window that displays the location (line and column) of the insertion point, or the endpoint of a just-changed selection range (if the cursor has not been moved yet after the change).

Show Current Function

This option displays the name of the function the insertion point is in (if any) at the bottom-left corner of the window.

Defaults

The following options control the presence and default position of text area visual indicators.

Show Page Guide

Enable this option to have TextWrangler display the Page Guide, which is a uniform light grey boundary region starting at the specified character width.

Note

This flexible boundary indicator replaces the historical Philip Bar margin indicator.

Show Tab Stops

Enable this option to have TextWrangler display tab stops as vertical grid lines within the content area of text windows, using the tab width set in the Fonts panel.

Show Line Numbers

This option displays line numbers along the left edge of the window.

Status Bar Controls:

These options let you choose which controls should appear on the status bar. To quickly enable or disable the visibility of all controls, you can click either Show All or Hide All, respectively.

Function Popup

This option displays the Function pop-up menu, which lists the functions (for source code files) or named anchors (for HTML files) in the document, allowing you to jump directly to any function or anchor.

Text Options

This option displays the Text Options pop-up menu, which allows you to set wrapping, display, and editing preferences for the current window, as with the Text Options command in the Edit menu.

Markers

This option displays the Mark pop-up menu, which lets you define and locate named markers in a document.

File Options

This option displays the File pop-up menu, which lets you set end-of-line and other compatibility options.

Insert Menu

This option displays the Insert pop-up menu, which lets you insert the contents of another text file (or a toolbox call template) into the current document.

File Path

This option displays the Path pop-up menu, which shows the location of the file being edited within the folder hierarchy. You can choose any folder from this menu to open it in the Finder.

Get Info Icon

This option displays the Info button, which opens an Info window showing the file's path, along with character, word, line, and page counts for the file and the selection.

Super Get Info Icon

This option displays the Super Get Info button, which asks Super Get Info to display file information pertaining to the current document. This option is available only if you have Super Get Info installed on your system.

Document Icon

This option displays the Document Icon button, which serves as a proxy for the document file. You can click the icon to reveal the current file in the Finder, or drag it anywhere the original file can be dragged.

Toggle Documents Drawer

This option displays the Document Drawer Toggle control at the right-hand side of the status bar.

Tools Preferences

The Tools preferences control the way TextWrangler integrates with programming tools, such as AppleScript editors, development environments and Toolbox references.

Script Editor

To set the script editor for use with the Open Script Editor command in the Script menu, do one of the following:

Coding Tools

The Coding Tools option lets you choose whether TextWrangler will display the Shebang menu for working with Unix scripts (see "Perl, Python, and Shell Scripting" in Chapter 12 of the user manual). In order for a change of this option to take effect, you must quit and relaunch TextWrangler.

Install Command Line Tools

The "Install Command Line Tools" button installs the current version of the "edit" and "twdiff" tools for invoking TextWrangler from the Unix command line. The first time you run TextWrangler after installation, it offers to install these tools for you. If you choose not to do so, you can use this button in the Tools preference panel to install the tools at a later time.

If the tools are already installed, the button will update them to a newer version if one is available; it will not overwrite existing versions of the tools with older versions. See Chapter 14 of the user manual for further details on the "edit" and "twdiff" command line tools.

Unix Scripting Preferences

The Unix Scripting preferences control how TextWrangler handles files which are run as Unix filters or scripts.

Use UTF-8 for Unix Script I/O

Mark this checkbox to have TextWrangler always send UTF-8 to Unix filters, and interpret Unix script output as UTF-8. This precludes the previous need for TextWrangler to create and execute a temporary copy of the script file, which could result in different behaviors for a script when run inside and outside of TextWrangler.

Warn About Non-Unix Line Breaks Before Running

Mark this checkbox to have TextWrangler post an alert when you attempt to run a filter or script which does not have Unix line breaks. Although TextWrangler transparently handles this case, most external environments do not; thus, it is recommended that you leave this option on.

Use Affrus for Perl Debugging

Mark this checkbox to have TextWrangler use Affrus in preference to the command line Perl Debugger. Affrus is an integrated Perl development environment from Late Night Software.

http://www.latenightsw.com/

If you choose this option, TextWrangler will pass complete environment parameters and control to Affrus, but will not attempt to retrieve output. If Affrus is not installed, this option will be disabled.

Windows Preferences

The Windows preferences control the size and appearance of both newly created windows and windows that do not contain their own display state information. (See the State panel to tell TextWrangler how to store state information in files.)

Window Zooming

Always Zoom Windows

Mark this checkbox to always expand windows to their maximum size when opening them, regardless of their saved window size state.

Move As Little As Possible

When this option is selected, TextWrangler keeps windows as close to their original location as possible when you zoom them.

Maximum Width

This pop-up menu lets you specify the maximum width of a zoomed window. The default setting is Classic Display.

Zoom Windows To

On systems with multiple monitors, this pop-up menu lets you choose which screen TextWrangler should use when zooming. You can choose the main screen (the one containing the menu bar), the nearest screen (the one containing most of the active window), the largest screen, or the smallest screen.

Window Menu

Always Show Full Paths

Mark this checkbox to show the complete pathname of open documents, rather than just their names, in TextWrangler's Window menu. If two or more files have identical filenames, their complete pathnames will always be shown to prevent ambiguity, regardless of this setting.

Group by Window Kind

Mark this checkbox to group windows of the same kind together in the Window menu. For example, text editing windows, disk browsers, and search results browsers are all different kinds of windows. Within each group, windows will be sorted as determined by the Sort Windows By radio buttons (see below).

Auto-Assign Shortcut Keys

Mark this checkbox to have TextWrangler automatically assign shortcut key equivalents of Command-0 through Command-9 to text windows or shell worksheets as these windows are created. If you leave this option off, these key equivalents will become available for assignment to other menu items via the Set Menu Keys command.

Sort Windows By

Select Name to list windows alphabetically by name, or Creation Order to list them in the order they were opened in the current TextWrangler session.

Window Stacking

These icons determine how TextWrangler stacks windows: down and to the left, straight down, directly atop, or down and to the right. TextWrangler stacks windows down and to the left by default.

Leave Room for Palettes

When this option is on, TextWrangler leaves room for any open floating palettes when creating or rearranging windows, if the palettes are stacked together such that at least one is against either the right-hand or left-hand edge of the screen. This option is on by default.

Leave Room for DragThing Docks

When this option is on, TextWrangler will also leave room for any visible DragThing docks when creating or rearranging windows.

Leave Room for Finder

When these options are selected, TextWrangler leaves room at the right side and/or the bottom of the screen so that you can see icons on the desktop. These options are off by default.

Optional settings via `defaults write'

In addition to the preference settings which can be made through the Preferences window, TextWrangler permits the following additional modifications to its behavior, which you can make by issuing an appropriate "defaults write" command.

Remove FTP/SFTP Commands from Menus

If you never use TextWrangler's FTP/SFTP-related commands, such as Open from FTP/SFTP Server, Save (A Copy) to FTP/SFTP Server, etc., you can remove them from the menus by issuing the following command in the Terminal, and then quitting and relaunching TextWrangler.

defaults write com.barebones.textwrangler FTP:HideFTPMenuCommands -bool true

If you have applied this change, but want TextWrangler to display the FTP/SFTP menu commands again, issue the following command in the Terminal, and then quit and relaunch TextWrangler.

defaults write com.barebones.TextWrangler FTP:HideFTPMenuCommands -bool false

Add Temporary Files to the Open Recent Menu

Ordinarily, TextWrangler will not add files to the Open Recent menu if they are located in the system temporary directories (/tmp or /private/tmp). However, if you routinely work with such files and want them to appear on the Open Recent menu, you may issue the following Terminal command.

defaults write com.barebones.textwrangler RememberRecentTempFiles -bool true

If you have applied this change, but no longer want to have such files added to the Open Recent menu, issue the following command in the Terminal.

defaults write com.barebones.textwrangler RememberRecentTempFiles -bool false